﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using VTMessenger.Resources;

namespace VTMessenger
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            App.MainViewModel = new ViewModels.ViewModel();

            DataContext = App.MainViewModel;

        }

        private async void btnLogin_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            await App.MainViewModel.Login(tbRoomName.Text, tbUserName.Text);
            //MessageBox.Show("Done.");
            NavigationService.Navigate(new Uri("/ChatPage.xaml",UriKind.Relative));
        }
    }
}